from django.contrib import admin

# Register your models here.
from .models import *


@admin.register(Domain_name)
class Domain_namelist(admin.ModelAdmin):
    list_display = ['domain', 'expiration', 'status', 'show_tags']

    def show_tags(self, obj):
        tag_list = []
        for tag in obj.tags.all():
            tag_list.append(tag.name)
        return ','.join(tag_list)

    show_tags.short_description = 'Tags'  # 设置表头


admin.site.register(Tag)
admin.site.site_header = '域名管理'
admin.site.site_title = '资管后台'
